package com.hmall.user.web;

import com.hmall.user.dto.LoginDto;
import com.hmall.user.vo.LoginVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    /**
     * 登录
     */
    @PostMapping("/login")
    public LoginVo findAddressById(@RequestBody LoginDto dto) {
        log.info("登录：{}", dto);
        return LoginVo.builder().username(dto.getUsername())
                .token(String.valueOf(System.currentTimeMillis()))
                .build();
    }
}
